package net.siufung.boot.elasticsearch.autoconfigure;

import net.siufung.boot.elasticsearch.service.IElasticsearchIndexService;
import net.siufung.boot.elasticsearch.service.impl.ElasticsearchIndexServiceImpl;
import org.elasticsearch.client.RestHighLevelClient;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author 陈建峰
 * @since 2022/6/16 10:36 上午
 */
@Configuration
public class ElasticsearchAutoConfig {

    @Bean
    @ConditionalOnBean
    public IElasticsearchIndexService elasticsearchIndexService(RestHighLevelClient restHighLevelClient){
        return new ElasticsearchIndexServiceImpl(restHighLevelClient);
    }
}


